package com.yequan.classload;

public class ClassLoadOrder {
    public static void main(String[] args) {
        new SB();
    }
}

class SA {
    D d;
    static {
        System.out.println("A 1");
    }
    {
        System.out.println("A 2");
        d = new D();
    }
    public SA() {
        System.out.println("A 3");
    }
}

class SB extends SA {
    static C c = new C();
    static {
        System.out.println("B 1");
    }
    {
        System.out.println("B 2");
    }
    public SB() {
        System.out.println("B 3");
    }
}

class C {
    static {
        System.out.println("C 1");
    }
    public C() {
        System.out.println("C 2");
    }
}

class D extends C {
    static {
        System.out.println("D 1");
    }
    public D() {
        System.out.println("D 2");
    }
}
